from django.db import models

# Create your models here.


class psn(models.Model):
    psnId = models.CharField(max_length=64, primary_key=True)
    username = models.CharField(max_length=64)
    password = models.CharField(max_length=64)
    email = models.CharField(max_length=30)
    tel = models.CharField(max_length=15)


class psn_resume(models.Model):
    resumeId = models.CharField(max_length=64, primary_key=True)
    psnId = models.CharField(max_length=64)
    email = models.CharField(max_length=30, default='example@example.com')
    tel = models.CharField(max_length=15, default='')
    name = models.CharField(max_length=20)
    age = models.IntegerField(default=0)
    sex = models.CharField(max_length=20)
    location = models.CharField(max_length=20)
    jobAdd = models.CharField(max_length=20)
    jobName = models.CharField(max_length=30)
    jobType = models.CharField(max_length=10)
    jobPay = models.CharField(max_length=12)
    nowStatus = models.CharField(max_length=2, default='0')
    updateTime = models.DateField(auto_now=True)
    workExp = models.CharField(max_length=15, default='')
    selfDisp = models.TextField(default='')
    psnTag = models.TextField(default='')
    degree = models.CharField(max_length=10)


class psn_resume_project_exprience(models.Model):
    projectId = models.CharField(max_length=64, primary_key=True)
    resumeId = models.CharField(max_length=64)
    projectName = models.CharField(max_length=30)
    jobName = models.CharField(max_length=30)
    orgName = models.CharField(max_length=50)
    startTime = models.DateField(auto_now=False, auto_now_add=False)
    endTime = models.DateField(auto_now=False, auto_now_add=False)
    tecName = models.CharField(max_length=30)
    projectDisp = models.TextField()


class psn_resume_work_exprience(models.Model):
    workId = models.CharField(max_length=64, primary_key=True)
    resumeId = models.CharField(max_length=64)
    jobName = models.CharField(max_length=30)
    companyName = models.CharField(max_length=50)
    startTime = models.DateField(auto_now=False, auto_now_add=False)
    endTime = models.DateField(auto_now=False, auto_now_add=False)
    workDisp = models.TextField()


class psn_resume_edu_exprience(models.Model):
    eduId = models.CharField(max_length=64, primary_key=True)
    resumeId = models.CharField(max_length=64)
    majorName = models.CharField(max_length=30)
    schoolName = models.CharField(max_length=50)
    gradTime = models.IntegerField(default=2019)
    degree = models.CharField(max_length=10)


class send_job(models.Model):
    recordId = models.CharField(max_length=64, primary_key=True)
    resumeId = models.CharField(max_length=64)
    psnId = models.CharField(max_length=64)
    entId = models.CharField(max_length=64)
    jobId = models.CharField(max_length=64)
    entName = models.CharField(max_length=50)
    jobName = models.CharField(max_length=20)
    status = models.CharField(max_length=10, default='5')
    sendTime = models.DateField(auto_now=True)
    wantJobName = models.CharField(max_length=20)
    wantJobPay = models.CharField(max_length=12)
    wantJobAdd = models.CharField(max_length=20)
    name = models.CharField(max_length=20)
    psnEmail = models.CharField(max_length=30)
    psnTel = models.CharField(max_length=15)
    entEmail = models.CharField(max_length=30)
    entTel = models.CharField(max_length=15)


class ent(models.Model):
    entId = models.CharField(max_length=64, primary_key=True)
    username = models.CharField(max_length=64)
    password = models.CharField(max_length=64)
    tel = models.CharField(max_length=15)
    email = models.CharField(max_length=30)
    entJobCount = models.IntegerField(default=10)


class ent_baseInfo(models.Model):
    entId = models.CharField(max_length=64, primary_key=True)
    entAddress = models.CharField(max_length=50)
    entName = models.CharField(max_length=50)
    entContectName = models.CharField(max_length=20, default='HR')
    entCertId = models.CharField(max_length=20)
    entClass = models.CharField(max_length=20, default='私营企业')
    entScale = models.CharField(max_length=20, default='1-49人')
    entSummary = models.TextField()
    entTag = models.TextField(default='五险一金')
    entIndustry = models.CharField(max_length=32)


class ent_jobs(models.Model):
    jobId = models.CharField(max_length=64, primary_key=True)
    entId = models.CharField(max_length=64)
    entName = models.CharField(max_length=50)
    entTag = models.TextField()
    jobName = models.CharField(max_length=20)
    jobAddress = models.CharField(max_length=50)
    jobPay = models.CharField(max_length=30, default='面议')
    jobType = models.CharField(max_length=10, default='全职')
    jobClass = models.CharField(max_length=50)
    jobDepart = models.CharField(max_length=30)
    email = models.CharField(max_length=30)
    degree = models.CharField(max_length=10, default='不限')
    workExp = models.CharField(max_length=15, default='不限')
    jobReq = models.TextField()
    updateTime = models.DateField(auto_now=True)
    jobFunc = models.CharField(max_length=255, default='不限')


class ent_order(models.Model):
    orderId = models.CharField(max_length=32, primary_key=True)
    entId = models.CharField(max_length=32)
    # 0-待支付, 1-已支付完成, 2-支付失败
    orderStatus = models.IntegerField(default=0)
    totalPrice = models.DecimalField(max_digits=12, decimal_places=4)
    updateTime = models.DateField(auto_now=True)
    # 支付前企业职位数量
    beforeEntJobCount = models.IntegerField(default=0)
    # 支付后企业职位数量
    afterEntJobCount = models.IntegerField(default=0)
    # 变动企业职位数量
    changeEntJobCount = models.IntegerField(default=0)


# makemigrations
# migrate
